﻿using IdentityServer4.EntityFramework.DbContexts;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infrastructure;
using Infrastructure.Util;

namespace Advance.Repositories.EntityFrameworkCore
{
    public class ConfigurationDbContextSeed
    {
        public async System.Threading.Tasks.Task SeedAsync(ConfigurationDbContext configurationDbContext, IServiceProvider services)
        {
            var clientSet = configurationDbContext.Clients;
            if (!clientSet.Any())
            {
                var clients = Config.GetClients();
                //clientSet.AddRangeAsync(clients);
                await configurationDbContext.SaveChangesAsync();
            }
        }
    }
}
